package com.tiheima.controller;

import com.tiheima.model.dto.LoginDTO;
import com.tiheima.model.result.Result;
import com.tiheima.model.vo.LoginVO;
import com.tiheima.service.EmpService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
public class LoginController {

    @Resource
    private EmpService empService;

    @PostMapping
    public Result<LoginVO> login(@RequestBody LoginDTO loginDTO) {
        return empService.login(loginDTO);
    }
}
